package com.xingyun.info_manager.dao;

import com.xingyun.info_manager.entity.AdminUser;
import com.xingyun.info_manager.entity.ParasBean;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface AdminInfoDao {
	/**
	 * 查询用户是否存在
	 * @param userName
	 * @return
	 */
//	@Select("select count(1) from admin_user where user_name = #{userName} and user_pwd = #{userPwd} ")
	public AdminUser findByNamePwd(@Param("userName") String userName, @Param("userPwd") String userPwd, @Param("channelId") int channelId);

	/**
	 * 查询所有用户信息
	 * @param parasBean
	 * @return
	 */
	public List<AdminUser> findAllUser(ParasBean parasBean);

	/**
	 * 查询总条数
	 * @param parasBean
	 * @return
	 */
	public int findCount(ParasBean parasBean);

	/**
	 * 新增
	 */
	public int addAdmin(AdminUser adminUser);

	/**
	 * 根据user_id查询用户信息
	 */
	public AdminUser findById(@Param("userId") int userId);

	/**
	 * 修改
	 */
	public int updateAdmin(AdminUser adminUser);

	/**
	 * 修改状态
	 */
	public int changeState(AdminUser adminUser);

	/**
	 * 删除记录
	 */
	public int delAdmin(@Param("userId") int userId);


	/**
	 * 根据用户名和渠道id查询用户是否存在
	 */
	public int getInfoByAdminChannelNo(@Param("userName") String userName,@Param("channelId") int channelId,@Param("userId") int userId);

}
